define(["jquery","bbcare","as/app/gms/gmsDetail.servers","as/app/gms/gmsDetail.ui","as/app/gms/gmsDetail.event"],
	function($,$bb,$servers,$ui,$event){
	var gmsDetail = {}; 

	/**
	 * 请求历史记录列表成功后的回调函数
	 */
	var ajaxHistoryCallBack = function(data){
		$ui.history({
			"id":"gmsDetailMenu",
			"list":data.rows
		});
		$("#gmsDetailMenu li").unbind("click");
		$("#gmsDetailMenu li").data({"rows":data.rows});
		$("#gmsDetailMenu li").click($event.onTestTimeSelect);
		$("#gmsDetailMenu li").eq(0).click();
	}

	gmsDetail.init = function(){
		var info =  $bb.getPageParams().info;
		var params = {
			"userId": info.userId,
            "examinationPaperName": info.type,
            "page": "1",
            "rows": "150"
		}
		$servers.ajaxHistory(params,ajaxHistoryCallBack);
	};


	return gmsDetail;
});